package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by fuyi on 2017/8/28.
 */

public class MessageCenterApi extends BaseApi {

    MessageCenterReq req;
    public MessageCenterApi(String member_id,int page) {
        req = new MessageCenterReq(member_id,page);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getMessageCenter(requestBody);
    }

    class MessageCenterReq {
        public String member_id;
        public String push_plat;//0-ios  1-android
        public int page;//0-ios  1-android

        public MessageCenterReq(String member_id,int page){
            this.member_id = member_id;
            this.push_plat="1";
            this.page=page;
        }
    }
}
